package com.dao.impl;

import com.dao.UserDao;
import com.entry.User;
import com.util.DBHelper;

import java.util.ArrayList;

public class UserDaoImpl implements UserDao {
    private DBHelper dbHelper = new DBHelper();
    @Override
    public ArrayList selectUser(User user) {
        String sql = "select * from User where account=? and password=? ";
        return dbHelper.selectinfo(sql,User.class,user.getAccount(),user.getPassword());
    }

    @Override
    public ArrayList selectUserByID(User user) {
        String sql = "select * from User where enterprise_id=?";
        return dbHelper.selectinfo(sql,User.class,user.getEnterprise_id());
    }
}
